/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package service;

import dao.OrganizationDao;
import java.util.List;
import myUtils.page.Result;
import po.Organization;
import po.User;
import po.Userorgrelation;

/**
 *
 * @author luyang
 */
public class OrgServiceImpl implements OrgService
{
    private OrganizationDao organizationDao;

    public void setOrganizationDao(OrganizationDao organizationDao )
    {
        this.organizationDao=organizationDao;
    }

    public void addOrg(Organization org)
    {
         this.organizationDao.addOrg(org);
    }

    public void deleteOrg(int id) 
    {
        this.organizationDao.deleteOrg(id);
    }

    public void updateOrg(Organization org)
    {
        this.organizationDao.updateOrg(org);
    }

    public Organization getOrg(int id)
    {
        return this.organizationDao.getOrg(id);
    }

    public Result getCheckedOrg(int page)
    {
        return this.organizationDao.getCheckedOrg(page);
    }

    public Result getUncheckedOrg(int page)
    {
        return this.organizationDao.getUncheckedOrg(page);
    }

    public Result getMembers(int id,int page)
    {
        return this.organizationDao.getMembers(id, page);
    }

    public User getManagerOfOrg(int id)
    {
        return this.organizationDao.getManagerOfOrg(id);
    }

    public Result getUncheckedMembers(int id, int page)
    {
        return this.organizationDao.getUncheckedMembers(id, page);
    }

    public Result getCheckedMembers(int id, int page)
    {
        return this.organizationDao.getCheckedMembers(id, page);
    }

    public boolean isLeader(int userId, int orgId) {
        return organizationDao.isLeader(userId, orgId);
    }

    public void deleteMemFromOrg(int userId, int orgId)
    {
        organizationDao.deleteMemFromOrg(userId, orgId);
    }

    public void approveUser(Userorgrelation userorgrelation)
    {
       // this.organizationDao.approveUser(userorgrelation);
    }

    public boolean isMember(int userId, int orgId)
    {
        return this.organizationDao.isMember(userId, orgId);
    }

}
